extends ../layout

block main
	ul.breadcrumb
		li
			i.icon-home
		li
			i.icon-angle-right
		li
			a(href="/") 面板
		li
			i.icon-angle-right
		li
			a(href="/merchants") 账户

	div(class="row-fluid sortable")
		div(class="box span12")
			div(class="box-header", data-original-title)
				h2
					i(class="halflings-icon user")
					span.break
					| 账户
			div.box-content
				if merchant.id
					- var action = "/merchants/" + merchant.id + "?app=" + app
				else
					- var action = "/merchants/" + "?app=#{app}"
				form(class="form-horizontal", action="#{action}", method="post")
					fieldset
						div.control-group
							label(class="control-label", for="name") 商户名
							div.controls
								input(class="input-xlarge focused validate[required]", id="name", name="name", type="text", value="#{merchant.get('name')}")
								<p class="help-block"></p>

						div.control-group
							label(class="control-label", for="license_no") 营业执照号码（统一社会信用代码）
							div.controls
								input(class="input-xlarge focused validate[required]", id="license_no", name="license_no", type="text", value="#{merchant.get('license_no')}")
								<p class="help-block"></p>

						div.control-group
							label(class="control-label", for="bank") 银行
							div.controls
								input(class="input-xlarge focused validate[required]", id="bank", name="bank", type="text", value="#{merchant.get('bank')}")
								<p class="help-block"></p>

						div.control-group
							label(class="control-label", for="bank_account_name") 银行开户名称（与营业执照名称一致）
							div.controls
								input(class="input-xlarge focused validate[required]", id="bank_account_name", name="bank_account_name", type="text", value="#{merchant.get('bank_account_name')}")
								<p class="help-block"></p>
								
						div.control-group
							label(class="control-label", for="bank_account") 银行帐号
							div.controls
								input(class="input-xlarge focused validate[required]", id="bank_account", name="bank_account", type="text", value="#{merchant.get('bank_account')}")
								<p class="help-block"></p>

						div.control-group
							label(class="control-label", for="contact_name") 联系人姓名
							div.controls
								input(class="input-xlarge focused validate[required]", id="contact_name", name="contact_name", type="text", value="#{merchant.get('contact_name')}")
								<p class="help-block"></p>

						div.control-group
							label(class="control-label", for="contact_mobile") 联系人电话
							div.controls
								input(class="input-xlarge focused validate[required]", id="contact_mobile", name="contact_mobile", type="text", value="#{merchant.get('contact_mobile')}")
								<p class="help-block"></p>

						div.control-group
							label(class="control-label", for="contact_email") 联系人电子邮箱
							div.controls
								input(class="input-xlarge focused validate[required]", id="contact_email", name="contact_email", type="text", value="#{merchant.get('contact_email')}")
								<p class="help-block"></p>

						div.control-group
							label(class="control-label", for="contact_address") 联系人地址
							div.controls
								input(class="input-xlarge focused validate[required]", id="contact_address", name="contact_address", type="text", value="#{merchant.get('contact_address')}")
								<p class="help-block"></p>


						div.control-group
							label(class="control-label", for="wx_mchid") 微信帐号
							div.controls
								input(class="input-xlarge focused validate[required]", id="wx_mchid", name="wx_mchid", type="text", value="#{merchant.get('wx_mchid')}")
								<p class="help-block"></p>

						div.control-group
							label(class="control-label", for="state") 状态
							div.controls
								select(id="state", name="state")
									option(selected=merchant.get('state') == 0, value=0) 申请中
									option(selected=merchant.get('state') == 1, value=1) 申请成功
									option(selected=merchant.get('state') == 2, value=2) 申请失败
									option(selected=merchant.get('state') == 3, value=3) 禁止中                                    

						div.form-actions
							button(type="submit", class="btn btn-primary") 保存
							button.btn 
								a(href="/merchants/#{merchant.id}") 取消
